package bean;

import converter.LocalDateTimeExcelTypeConverter;
import converter.LocalDateTimeStrExcelTypeConverter;
import fun.ltool.core.excel.annotation.ExcelEntity;
import fun.ltool.core.excel.annotation.ExcelField;
import fun.ltool.core.excel.enums.DataTypeEnum;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@ExcelEntity(rowRange = {0, 6}, columnRange = {0, 20}, dataType = DataTypeEnum.DATA_TABLE_MODE)
@Data
public class ExcelTableBean {
    @ExcelField(cellName = {"合计", "累计金额（万元）"},
            cellPosition = {3, 1},
            rowNamePosition = {3, 0},
            columnNamePosition = {2, 1},
            isThrowError = true)
    private BigDecimal sumTotal;
    @ExcelField(name = "合计 本年金额（万元）", cellPosition = {3, 2}, isThrowError = true)
    private Float totalYear;
    @ExcelField(cellName = {"合计", "完成时间"},
            cellPosition = {3, 4},
            rowNamePosition = {3, 0},
            columnNamePosition = {2, 4},
            isThrowError = true)
    private LocalDateTime totalTime;
    @ExcelField(cellName = {"项目1", "完成时间"},
            cellPosition = {4, 4},
            rowNamePosition = {4, 0},
            columnNamePosition = {2, 4},
            typeConverter = LocalDateTimeExcelTypeConverter.class,
            isThrowError = true)
    private LocalDateTime projectOneTime;
    @ExcelField(cellName = {"项目2", "完成时间"},
            cellPosition = {5, 4},
            rowNamePosition = {5, 0},
            columnNamePosition = {2, 4},
            typeConverter = LocalDateTimeStrExcelTypeConverter.class,
            isThrowError = true)
    private String projectTwoTime;
}
